﻿using BBCore.Core.Models.Admins;
using BootstrapBlazor.Components;
using Microsoft.AspNetCore.Components;
using System.Diagnostics.CodeAnalysis;

namespace BBCore.Server.Components.Pages.Admins
{
    public partial class AnnouncementPage
    {
        [Inject]
        [NotNull]
        private IDispatchService<string>? DispatchService { get; set; }
        private async Task<bool> OnSaveAsync(Announcement arg1, ItemChangedType arg2)
        {
            await arg1.SaveAsync();//保存
            DispatchService.Dispatch(new DispatchEntry<string>()
            {
                Name = arg1.Title,
                Entry = arg1.Content
            });
            return true;
        }

    }
}
